/*
 * @Author: 颜礼田 2564217790@qq.com
 * @Date: 2024-08-26 17:13:13
 * @LastEditors: 颜礼田 2564217790@qq.com
 * @LastEditTime: 2024-09-10 17:33:08
 * @FilePath: /turo-repo-enterprise/apps/fuck-enterprise-admin/src/stores/modules/permission.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { PORT1 } from "@/api/config/servicePort";
import { Id, ReqPage } from "@/api/interface";
import { PermissionSchema } from "@/schema";
import http from "../";

export function fetchPermissionList(data: ReqPage) {
  return http.post<PermissionSchema>(`${PORT1}/permission/list`, data);
}

export function savePermission(data: PermissionSchema) {
  return http.post<PermissionSchema>(`${PORT1}/permission/save`, data);
}

export function removePermission(params: Id) {
  return http.delete<PermissionSchema>(`${PORT1}/permission/remove`, params);
}

export function editPermission(params: Id, data: PermissionSchema) {
  return http.put<PermissionSchema>(`${PORT1}/permission/edit`, data, { params });
}

export function fetchPermissionInfo(params: Id) {
  return http.get<PermissionSchema>(`${PORT1}/permission/info`, params);
}
